#include <stdio.h>
#include <string.h>
_Bool isdel(const char *source, const char *delimiter, int i)
{
    for (int j = 0; j < strlen(delimiter); j++)
    {
        if (source[i + j] != delimiter[j])
            return 0;
    }
    return 1;
}
void split_string(char target[100], const char *source, const char *delimiter, int m)
{
 
    for (int i = m; source[i] != 0; i++)
    {
        target[i - m] = source[i];
        if (isdel(source, delimiter, i))
        {
            target[i - m] = 0;
            split_string(target + 100, source, delimiter, i + strlen(delimiter));
            break;
        }
    }
}
int main()
{
    char src[100], del[100], tar[99][100] = {0};
    scanf("%s", src);
    scanf("%s", del);
    split_string(tar[0], src, del, 0);
    for (int i = 0; i < 99; i++)
    {
        if (tar[i][0] != 0)
            printf("%s\n", tar[i]);
    }
    return 0;
}
